//2024.10.21
//某个笨蛋写得

const valueMap = {
  在线: { status: 10, extStatus: 0, batteryStatus: 0 },           // Online
  悄悄我: { status: 60, extStatus: 0, batteryStatus: 0 },          // Q Me
  离开: { status: 30, extStatus: 0, batteryStatus: 0 },           // Away
  忙碌: { status: 50, extStatus: 0, batteryStatus: 0 },           // Busy
  请勿打扰: { status: 70, extStatus: 0, batteryStatus: 0 },       // Do Not Disturb
  隐身: { status: 40, extStatus: 0, batteryStatus: 0 },           // Invisible
  听歌中: { status: 10, extStatus: 1028, batteryStatus: 0 },       // Listening to Music
  春日限定: { status: 10, extStatus: 2037, batteryStatus: 0 },    // Spring Limited
  元素憧憬: { status: 10, extStatus: 2025, batteryStatus: 0 },    // Elemental Dreaming
  星空觅友: { status: 10, extStatus: 2026, batteryStatus: 0 },    // Looking for a Partner in Starlight
  破产了: { status: 10, extStatus: 2014, batteryStatus: 0 },       // Broke
  今日天气: { status: 10, extStatus: 1030, batteryStatus: 0 },    // Today's Weather
  崩溃了: { status: 10, extStatus: 2019, batteryStatus: 0 },       // I've Crashed
  爱你哟: { status: 10, extStatus: 2006, batteryStatus: 0 },       // Love You
  恋爱中: { status: 10, extStatus: 1051, batteryStatus: 0 },       // In Love
  锦鲤附体: { status: 10, extStatus: 1071, batteryStatus: 0 },     // Lucky Koi
  水逆退散: { status: 10, extStatus: 1201, batteryStatus: 0 },     // Retrograde Mercury Retreat
  精神抖擞: { status: 10, extStatus: 1056, batteryStatus: 0 },     // High and Flying
  元气满满: { status: 10, extStatus: 1058, batteryStatus: 0 },     // Full of Vitality
  认证宝宝: { status: 10, extStatus: 1070, batteryStatus: 0 },     // Baby Verified
  难以言说: { status: 10, extStatus: 1063, batteryStatus: 0 },     // Hard to Say
  复杂心情: { status: 10, extStatus: 2001, batteryStatus: 0 },     // It's Complicated
  忧伤模式: { status: 10, extStatus: 1401, batteryStatus: 0 },     // Emo Mode
  正在努力: { status: 10, extStatus: 1062, batteryStatus: 0 },     // I'm Struggling
  现在很好: { status: 10, extStatus: 2013, batteryStatus: 0 },     // I'm Fine Now
  我很好: { status: 10, extStatus: 1052, batteryStatus: 0 },       // I'm Fine
  需要安静: { status: 10, extStatus: 1061, batteryStatus: 0 },     // Need to Be Quiet
  闲散中: { status: 10, extStatus: 1059, batteryStatus: 0 },       // Chilling
  在旅行: { status: 10, extStatus: 2015, batteryStatus: 0 },       // Traveling
  信号弱: { status: 10, extStatus: 1011, batteryStatus: 0 },       // Weak Signal
  外出中: { status: 10, extStatus: 2003, batteryStatus: 0 },       // Going Out
  在做作业: { status: 10, extStatus: 2012, batteryStatus: 0 },     // Doing Homework
  在学习: { status: 10, extStatus: 1018, batteryStatus: 0 },       // Studying
  在工作: { status: 10, extStatus: 2023, batteryStatus: 0 },       // Working
  摸鱼中: { status: 10, extStatus: 1300, batteryStatus: 0 },       // Slacking Off
  无聊中: { status: 10, extStatus: 1060, batteryStatus: 0 },       // Bored
  玩机模式: { status: 10, extStatus: 1027, batteryStatus: 0 },     // Timi Mode
  在睡觉: { status: 10, extStatus: 1016, batteryStatus: 0 },       // Sleeping
  熬夜中: { status: 10, extStatus: 1032, batteryStatus: 0 },       // Pulling an All-Nighter
  在追剧: { status: 10, extStatus: 1021, batteryStatus: 0 },       // Binge-Watching
  电量: { status: 10, extStatus: 1000, batteryStatus: 0 },          // Battery Level
}

export class girl extends plugin {
  constructor () {
    super({
      name: '改状态',
      dsc: '改状态',
      event: 'message',
      priority: -100000000000000000000,
      rule: [
        {
          reg: '^#改状态([\\s\\S]*)$',
          fnc: 'jh'
        }
      ]
    })
  }

  // 聚合
  async jh (e) {
    const statusNames = Object.keys(valueMap);
    let message = e.msg.replace('#改状态', '').trim()
    if (message && valueMap[message]) {
        const name = await valueMap[message]
        
        const requestData = {
          status: name.status,
          ext_status: name.extStatus,
          battery_status: name.batteryStatus,
        }
    
        await e.bot.sendApi('set_online_status', requestData)
        e.reply(`状态已更新为:${message}`)
    } else {
        const formattedStatusNames = statusNames.map(status => `${status}、`).join('');
        e.reply(`可用状态列表如下:\n${formattedStatusNames.slice(0, -1)}`)
    }

  }
}



